﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Mjudoku.sudokuTasks
{
    class SimpleTaskLoader :TaskLoader
    {

        public int[,] loadTask(int size)
        {
            int[][,] array4 = new int[][,]{
                new int[,]{
                    {3,4,1,0},
                    {0,2,0,0},
                    {0,0,2,0},
                    {0,1,4,3}
                },
            
                new int[,]{
                    {0,2,0,0},
                    {0,1,4,0},
                    {0,0,3,0},
                    {0,0,0,0}
                }                        
            };

            int[][,] array9 = new int[][,]{
                new int[,]{
                    {4,0,5,0,9,2,0,0,7},
                    {1,2,8,0,0,0,9,0,6},
                    {0,0,6,0,1,0,2,0,0},
                    {0,0,0,1,6,0,0,0,0},
                    {7,6,0,8,0,4,0,0,9},
                    {5,8,0,0,0,9,0,0,2},
                    {0,9,0,0,0,7,3,0,1},
                    {3,1,0,0,0,0,8,0,0},
                    {0,5,0,0,3,1,6,9,0}
                },
            
                new int[,]{
                    {0,0,9,0,0,6,0,0,3},
                    {0,0,8,9,4,0,0,1,2},
                    {1,0,2,7,0,8,0,4,6},
                    {0,0,0,8,0,0,0,2,5},
                    {4,2,1,0,5,7,6,9,0},
                    {0,0,5,0,2,0,3,0,0},
                    {8,0,0,0,0,0,0,0,0},
                    {2,7,0,0,0,3,5,0,1},
                    {0,0,0,0,0,1,0,6,7}

                }                        
            };

            if (size == 4) {
                Random r = new Random();
                int rnd = r.Next(0, array4.Length);
                return array4[rnd];
            }
            else
            {
                Random r = new Random();
                int rnd = r.Next(0, array9.Length);
                return array9[rnd];
            }
        }
    }
}
